package com.huang.springboot.dao;

import com.huang.springboot.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author yili_gi
 */
@Mapper
@Repository
public interface EmployeeMapper {

    /**
     * 获取所有员工信息
     * @return
     */
    List<Employee> getEmployees();

    /**
     * 通过员工id获取员工
     * @param id
     * @return
     */
    Employee getEmployeeById(@Param("id") int id);

    /**
     * 通过员工id获取员工部门
     * @param id
     * @return
     */
    int getEmployeeDepartment(@Param("id") int id);

    /**《
     * 增加员工
     * @param employee
     * @return
     */
    int addEmployee(Employee employee);

    /**
     * 通过员工id删除员工
     * @param id
     * @return
     */
    int removeEmployee(@Param("id") int id);

    /**
     * 修改员工信息
     * @param employee
     * @return
     */
    int updateEmployee(Employee employee);

}
